# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-jmespath
_pkgname=jmespath
pkgver=0.9.4
pkgrel=4
pkgdesc='JSON Matching Expressions.'
url='https://pypi.org/project/jmespath/#files'
arch=('any')
license=('MIT')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('173ec36708f93f72fece049b71846a226010c00498ab51e58bee26a09cc73cf96a062df215d3737eb266e689c2ecf7a2be95b009ed74ad122f6739d4379466c6')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/jp.py" "$pkgdir/usr/bin/jp.py2"
}

